package sac.modelo.data.transacciones;

/**
 * "Visual Paradigm: DO NOT MODIFY THIS FILE!"
 * 
 * This is an automatic generated file. It will be regenerated every time 
 * you generate persistence class.
 * 
 * Modifying its content may cause the program not work, or your work may lost.
 */

/**
 * Licensee: 
 * License Type: Evaluation
 */
import java.io.Serializable;
import javax.persistence.*;

import sac.modelo.data.maestros.Cabriton;
import sac.modelo.data.maestros.Vendedor;
@Entity
@org.hibernate.annotations.Proxy(lazy=false)
@Table(name="Compra_Cabrito")
public class CompraCabrito implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public CompraCabrito() {
	}
	
	@Column(name="id_compra", nullable=false)	
	@Id		
	private int id_compra;
	
	@Column(name="costo_compra", nullable=true)	
	private Float costo_compra;
	
	@Column(name="fecha_compra", nullable=true)	
	@Temporal(TemporalType.DATE)	
	private java.util.Date fecha_compra;
	
	@ManyToOne(targetEntity=Vendedor.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.LOCK})	
	@JoinColumns({ @JoinColumn(name="Vendedorcedula_vendedor", referencedColumnName="cedula_vendedor", nullable=false) })	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	private Vendedor vendedorcedula_vendedor;
	
	@OneToOne(mappedBy="compra_Cabritoid_compra", targetEntity=Cabriton.class, fetch=FetchType.LAZY)	
	@org.hibernate.annotations.Cascade({org.hibernate.annotations.CascadeType.SAVE_UPDATE, org.hibernate.annotations.CascadeType.LOCK})	
	@org.hibernate.annotations.LazyToOne(value=org.hibernate.annotations.LazyToOneOption.NO_PROXY)	
	private Cabriton cabriton;
	
	private void setId_compra(int value) {
		this.id_compra = value;
	}
	
	public int getId_compra() {
		return id_compra;
	}
	
	public int getORMID() {
		return getId_compra();
	}
	
	public void setCosto_compra(float value) {
		setCosto_compra(new Float(value));
	}
	
	public void setCosto_compra(Float value) {
		this.costo_compra = value;
	}
	
	public Float getCosto_compra() {
		return costo_compra;
	}
	
	public void setFecha_compra(java.util.Date value) {
		this.fecha_compra = value;
	}
	
	public java.util.Date getFecha_compra() {
		return fecha_compra;
	}
	
	public void setVendedorcedula_vendedor(Vendedor value) {
		this.vendedorcedula_vendedor = value;
	}
	
	public Vendedor getVendedorcedula_vendedor() {
		return vendedorcedula_vendedor;
	}
	
	public void setCabriton(Cabriton value) {
		this.cabriton = value;
	}
	
	public Cabriton getCabriton() {
		return cabriton;
	}
	
	public String toString() {
		return String.valueOf(getId_compra());
	}
	
}
